<!-- pinlun -->
<template>
	<view>
		<view class="heighly m-mg-lr">
			<view class="u-p-b-10" v-if="dataList.length > 0">
				<view class="u-flex u-flex-between u-p-t-20 u-p-b-20" 
				style="border-bottom: 1rpx solid #dadbde;" v-for="(item, index) in dataList" :key="index">
					<view class="u-flex u-flex-items-center">
						<u-avatar shape="circle" size="50" :src="item.avatar || df"></u-avatar>
						<view class="u-m-l-20">
							<view class="u-flex">
								<view class="ca0 u-font-18">{{ item.nickname || '昵称0' + (index + 1) }}</view>
								<view class="ca0 u-m-l-20 u-font-16">{{ $u.timeFormat(item.createtime, 'yyyy-mm-dd hh-MM') }}</view>
							</view>
							<view class="c63 u-line-1 u-m-t-20">{{ item.content }}</view>
						</view>
					</view>
					<view class="u-flex u-flex-items-start">
						<!-- <u-icon name="xiaoxi" customPrefix="master" color="#acacac" size="18"></u-icon> -->
						<u-icon :name="item.iszan == 1 ? 'thumb-up-fill' :'thumb-up'" :color="item.iszan == 1 ? '#0E5543' :'#acacac'" size="18" @click="gozan(item.id,item.iszan)"></u-icon>
					</view>
				</view>
			</view>
			<list-empty v-else text="暂时没有数据哟!" list="data" :listHighly="highly"></list-empty>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {};
		},
		async onLoad(e) {
			// #ifdef MP-WEIXIN
			uni.hideShareMenu()
			// #endif
			if(e.id){
				this.path = 'getcommentlist';
				this.params = {
					...this.params,
					id: +e.id,
					pnum: this.pnum,
				}
				await this.getList();
			}
		},
		methods:{
			async gozan(id, iszan) {
				let res = await this.require('zancomment', {
					id,
					type: iszan
				});
				if (res) {
					this.getlun(this.id);
				}
			},
		}
	}
</script>

<style lang="scss" scoped>
.ca0 {
	color: #a0a0a0;
	font-size: 24rpx;
}

.c63 {
	color: #636363;
}
</style>
